from ... import *


@pytest.mark.skipif(not Config.jx3_token, reason="无apitoken时不测试")
def test_recruit():
    import src.plugins.jx3.recruit
    func = src.plugins.jx3.recruit.jx3_recruit_v2

    def handle_finish(msg: str):
        assert False, f'fail run:{msg}'
    mc = MessageCallback(handle_finish)

    src.plugins.jx3.recruit.jx3_cmd_recruit_v2 = mc
    from src.plugins.jx3.bind import server_bind

    event = SFGroupMessageEvent(group_id=2114123)
    server_bind(event.group_id, '双梦')
    task = func(event, obMessage('x 武狱黑牢'))
    asyncio.run(task)
    mc.check_counter()
    server_bind(event.group_id, '')
